import { reqGoodsList } from "@/api";
import { reqPagination } from "@/api";
export default {
  state: {
    // goodsList: [],
    paginationList: [],
  },
  mutations: {
    // UPDATE_GOODSLIST(state, goodsList) {
    //   state.goodsList = goodsList;
    // },
    UPDATE_PAGINATION(state, paginationList) {
      state.paginationList = paginationList;
    },
  },
  actions: {
    // async getGoodsList({ commit }) {
    //   const res = await reqGoodsList();
    //   console.log(res);
    //   commit("UPDATE_GOODSLIST", res);
    // },
    async getPagination({ commit }, { page, limit }) {
      const res = await reqPagination(page, limit);
      console.log(res);
      commit("UPDATE_PAGINATION", res);
    },
  },
};
